home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / tpu2tps.arc / TPU2TPS.DOC < prev    next >
Text File  |  1991-07-23  |  4KB  |  91 lines

  1. TPU2TPS - Extracts SYSTEM.TPS from TP6.0/TPW1.0 run-time library
  2.  
  3. Written by D.J. Murdoch for the public domain, July 1991, after
  4. having my curiosity piqued by Mitch Davis.
  5.  
  6. Syntax:
  7.  
  8.   TPU2TPS
  9.  
  10. will read SYSTEM.TPU, and create SYSTEM.TPS, suitable for recompiling
  11. into a new version of SYSTEM.TPU.
  12.  
  13.  
  14. What does it do?
  15.  
  16. Turbo Pascal keeps most of the run-time library in the SYSTEM unit,
  17. which is usually stored in SYSTEM.TPU within TURBO.TPL or TPW.TPL.  To
  18. recompile it, you need a special "bootstrap file" called SYSTEM.TPS.
  19. This program, TPU2TPS, extracts the bootstrap file from a compiled
  20. version of SYSTEM.TPU.
  21.  
  22.  
  23. What use is it?
  24.  
  25. If you have SYSTEM.TPS in the current directory, you can compile a new
  26. SYSTEM unit and change the run-time library.  Why bother?  Perhaps you
  27. don't need any of the standard library; if you're writing a tiny utility
  28. that doesn't use any of its services, there's no point linking in
  29. several K of it that won't be used.  The included SYSTEM.PAS is an
  30. absolutely minimal replacement; using it, you can shrink the sample
  31. TEST.PAS from an .EXE size of 1400 bytes down to 128 bytes.  Everyone
  32. will think you wrote it in assembler.
  33.  
  34.  
  35. How do I use it?
  36.  
  37. First, get a copy of SYSTEM.TPU from TP 6.0 or TPW 1.0 (or compatible
  38. later versions) in the current directory.  You may have to use TPUMOVER
  39. to get it out of TURBO.TPL or TPW.TPL; the syntax to use is
  40.  
  41.   TPUMOVER TURBO *SYSTEM
  42.      or
  43.   TPUMOVER TPW   *SYSTEM
  44.  
  45. Then, run TPU2TPS.  It'll create SYSTEM.TPS (or tell you that something
  46. has gone wrong).
  47.  
  48. Next, get rid of the original SYSTEM.TPU (keeping a copy of course!),
  49. and compile SYSTEM.PAS.  (You may want to make some changes to it
  50. first.)  This should give you a new version of SYSTEM.TPU.  Don't put it
  51. into *.TPL unless you're very sure of yourself; it is almost certainly
  52. not the one you want to use as a default.
  53.  
  54. Finally, hide the old SYSTEM.TPU and *.TPL; be sure they aren't on the
  55. path, in the .TPU directory, or in the same directory as your compiler.
  56. Make sure that the new SYSTEM.TPU is available in one of those places,
  57. and compile TEST.PAS or another program of your choice.  Don't use any
  58. system procedures or functions; don't use strings, sets, longints,
  59. floating point, or files; don't use dynamic memory or overlays; disable
  60. stack and range checking, IEEE reals, and floating point emulation.  All
  61. of those need a real SYSTEM.TPU.
  62.  
  63. If you use one of those by mistake, you'll be in real trouble:  the
  64. compiler doesn't expect you to fool around with SYSTEM.TPU this way, and
  65. it can get very, very confused if it goes looking for services that
  66. aren't there.  A more robust SYSTEM replacement would halt with an error
  67. if you tried any of those things, but the included one won't.  (There
  68. are over 130 functions/procedures in the real thing; I was too lazy to
  69. code that many stubs!)
  70.  
  71.  
  72. What does it cost?
  73.  
  74. Absolutely nothing!  Play around with it.  Buy the real run-time library
  75. if you want something a little less minimalist.  If you really like it,
  76. and want to send money somewhere, send it to a local charity.
  77.  
  78.  
  79. Where do I complain if it doesn't work?
  80.  
  81. You expect support for freebies?  Give me a break.  TPU2TPS comes with
  82. no warranties of any kind; I haven't tested it very well; if you like
  83. playing with things like this, you'd better be prepared to reboot
  84. frequently.
  85.  
  86.  
  87.  D.J. Murdoch
  88.  DJ Murdoch at Fidonet node 1:221/177.40
  89.  dmurdoch@watstat.waterloo.edu
  90.  71631,122 on Compuserve
  91.